package com.binarytree;

public class Solution22 {

    public TreeNode searchBST(TreeNode root, int val) {
        if (root == null ||root.val==val) return root;

        if (root.val > val) return searchBST(root.left,val);
        else return searchBST(root.right,val);
    }

}
